/**
 *====================================================
* 文件名称: FinanceBulkstockColdStorageServiceImpl.java
 * 修订记录：
  * No    日期				作者(操作:具体内容)
  * 1.    2015年12月04日	chenxy(创建:创建文件)
  *====================================================
  * 类描述：(说明未实现或其它不应生成javadoc的内容)
  */
package com.yuexunit.finance.project.service;

import java.util.List;

import org.hibernate.criterion.DetachedCriteria;
import org.hibernate.criterion.Restrictions;

import com.yuexunit.finance.project.entity.FinanceBulkstockColdStorageEntity;
import com.yuexunit.inject.annotation.Implements;
import com.yuexunit.persist.PersistUtil;

/**
 * @ClassName: FinanceBulkstockColdStorageServiceImpl
 * @Description: TODO(这里用一句话描述这个类的作用)
 * @author chenxy
 * @date 2015年12月04日 15:03:09
 */
@Implements(FinanceBulkstockColdStorageService.class)
public class FinanceBulkstockColdStorageServiceImpl implements FinanceBulkstockColdStorageService {

	@Override
	public Long createFinanceBulkstockColdStorage(FinanceBulkstockColdStorageEntity entity) {
		PersistUtil.insert(entity);
		return entity.getBulkstockId();
	}

	@Override
	public void deleteFinanceBulkstockColdStorage(FinanceBulkstockColdStorageEntity entity) {
		PersistUtil.delete(entity);
	}

	@Override
	public FinanceBulkstockColdStorageEntity inquireFinanceBulkstockColdStorage(Long bulkstockId) {
		return PersistUtil.get(FinanceBulkstockColdStorageEntity.class, bulkstockId);
	}

	@Override
	public List<FinanceBulkstockColdStorageEntity> inquireFinanceBulkstockColdStorageList(Long financeId) {
		DetachedCriteria criteria = DetachedCriteria.forClass(FinanceBulkstockColdStorageEntity.class);
		criteria.add(Restrictions.eq("financeId", financeId));
		return PersistUtil.get(criteria);
	}

}
